import { Route, Routes, Navigate } from 'react-router-dom'
import { Suspense, lazy } from 'react';

const Login = lazy(() => import("./pages/login"));
const Index = lazy(() => import("./pages/index"));

function App() {
  return (
    <div className='app'>
      <Suspense fallback={<div>视图正在加载!</div>}>
        <Routes>
          <Route path='/login' element={<Login />}></Route>
          <Route path='/index/*' element={<Index />}></Route>
          <Route path="*" element={<Navigate to="/index"></Navigate>}></Route>
        </Routes>
      </Suspense>
    </div>
  );
}

export default App;
